#include <iostream>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <string>
using namespace std;

//typedef struct ListNode
//{
//	int sex;
//	struct ListNode* next;
//}ListNode;
//
//ostream& operator<<(ostream& out, ListNode* p)
//{
//	out << p->sex << endl;
//}
//
//int main()
//{
//	return 0;
//}

class Solution {
public:
    int StrToInt(string str) {
        int n = str.size();
        int sum = 0;
        for (int i = 0; i < n; i++)
        {
            if (i == 0 && str[i] == '+')
            {
                continue;
            }
            else if (i == 0 && str[i] == '-')
            {
                continue;
            }
            if (str[i] < '0' || str[i]>'9')
            {
                return 0;
            }
            sum = sum * 10 + (str[i] - '0');
            if (i == n - 1 && str[0] == '-')
            {
                sum = -sum;
            }
        }
        return sum;
    }
};

class Solution {
public:
    int firstUniqChar(string s) {
        int str[26] = { 0 };
        int n = s.size();
        for (auto n : s)
        {
            str[n - 'a']++;
        }
        for (int i = 0; i < n; i++)
        {
            if (str[s[i] - 'a'] == 1)
            {
                return i;
            }
        }
        return -1;
    }
};

class Solution {
public:
    void reverseString(vector<char>& s) {
        int left = 0;
        int right = size(s) - 1;
        while (left < right)
        {
            char k = s[left];
            s[left] = s[right];
            s[right] = k;
            left++;
            right--;
        }
    }
};